/**
 * 作者: wgx
 * 日期: 2025-04-29 10:56:22
 * 备注: 大世界事件配置表
 */
package com.motu.monstercity.server.game.commondata.world;

import io.vertx.core.json.JsonObject;

public class WorldEventModel {
    protected int id; // id
    protected int eventGroup; // 随机事件组
    protected int quality; // 事件品质 (依据world_radar 表event_rate配置确定权重)
    protected int type; // 事件类型
    protected int eventEnergy; // 派遣出征时需要支付的体力
    protected int troopsLimit; // 事件要求的兵力下限
    protected int troopsRatio; // 兵力加成段
    protected String reward; // 普通完成的事件奖励
    protected String perfectReward; // 完美完成的事件奖励
    protected String distanceRate; // 距离权重
    protected int fightRate; // 战斗的概率 (搜救事件需要用到，有概率不战斗)
    protected String chipId; // 碎片奖励
    protected long monsterPower; // 怪兽实力 (比如悬赏事件，不根据怪物等级取战力，直接取这个配置的值)
    protected int boxId; // 随机奖励配置，玩家预览

    public WorldEventModel() {
    }

    public WorldEventModel(JsonObject obj) {
        id = obj.containsKey("id") ? obj.getInteger("id") : 0;
        eventGroup = obj.containsKey("event_group") ? obj.getInteger("event_group") : 0;
        quality = obj.containsKey("quality") ? obj.getInteger("quality") : 0;
        type = obj.containsKey("type") ? obj.getInteger("type") : 0;
        eventEnergy = obj.containsKey("event_energy") ? obj.getInteger("event_energy") : 0;
        troopsLimit = obj.containsKey("troops_limit") ? obj.getInteger("troops_limit") : 0;
        troopsRatio = obj.containsKey("troops_ratio") ? obj.getInteger("troops_ratio") : 0;
        reward = obj.containsKey("reward") ? obj.getString("reward") : "";
        perfectReward = obj.containsKey("perfect_reward") ? obj.getString("perfect_reward") : "";
        distanceRate = obj.containsKey("distance_rate") ? obj.getString("distance_rate") : "";
        fightRate = obj.containsKey("fight_rate") ? obj.getInteger("fight_rate") : 0;
        chipId = obj.containsKey("chip_id") ? obj.getString("chip_id") : "";
        monsterPower = obj.containsKey("monster_power") ? obj.getLong("monster_power") : 0;
        boxId = obj.containsKey("box_id") ? obj.getInteger("box_id") : 0;
    }

    public int getId() {
        return id;
    }

    public int getEventGroup() {
        return eventGroup;
    }

    public int getQuality() {
        return quality;
    }

    public int getType() {
        return type;
    }

    public int getEventEnergy() {
        return eventEnergy;
    }

    public int getTroopsLimit() {
        return troopsLimit;
    }

    public int getTroopsRatio() {
        return troopsRatio;
    }

    public String getReward() {
        return reward;
    }

    public String getPerfectReward() {
        return perfectReward;
    }

    public String getDistanceRate() {
        return distanceRate;
    }

    public int getFightRate() {
        return fightRate;
    }

    public String getChipId() {
        return chipId;
    }

    public long getMonsterPower() {
        return monsterPower;
    }

    public int getBoxId() {
        return boxId;
    }

}
